<script setup lang="ts">
const props: any = defineProps<{
    ujt: any;
    module: any;
}>();

const { $global, $fn } = props.ujt;
// 定义模块信息
$global.module.value = props.module?.value;
$global.module.label = props.module?.label;

// 初始化模块ws
if (props.module?.ws) {
    $fn.useWs(props.ujt, $global.module.value);
}

// 初始化逻辑APP模块
const { initAppModel } = $fn.useInitApp(props.ujt);
$global.stat[$global.module.value] = 0;
initAppModel($global.module.value).then((res: any) => {
    $global.stat[$global.module.value] = 1;
});
</script>

<template>
    <RouterView
        v-if="props.module?.value && $global.stat[props.module.value]"
        :ujt="ujt"
        :ty="0"
    ></RouterView>
    <component
        v-else
        :ujt="ujt"
        :is="$global.sys?.router?.config?.loading || 'PageLoadErr'"
    ></component>
</template>

<style lang="scss"></style>
